home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 05.zip / BS1 part 5 / BaudBandit.adf / REXX / UnArc.baud < prev    next >
Text File  |  1989-07-14  |  930b  |  39 lines

  1. /* UnArc.baud
  2.  
  3.    Place in a function key as '\mUnArc'
  4.    and run after downloading arc/zoo/zip files
  5. */
  6.  
  7. OPTIONS RESULTS
  8.  
  9. STATUS Name                /* Get the filename */
  10. filename = RESULT
  11.  
  12. if filename = '' then do        /* No file ? */
  13.     GETFILE 'File to Extract'    /* Ask for a file */
  14.     if RESULT = '' then exit    /* Did user hit Cancel? */
  15.  
  16.     STATUS Name            /* Get the filename again */
  17.     filename = RESULT
  18.   end
  19.  
  20. STATUS DataDirectory            /* Get the current directory */
  21. dir = RESULT
  22.  
  23. parse UPPER var filename name'.'ext    /* ext is extension (ARC/ZOO/ZIP) */
  24.  
  25.  
  26. /* Determine command to use by extension.
  27.    The '<*' redirects input to the terminal.
  28. */
  29.  
  30. if left(ext,2) = 'ZO' then arcmd = 'Zoo <* x'
  31.  else if left(ext,2) = 'AR' then arcmd = 'Arc <* x'
  32.   else if left(ext,2) = 'ZI' then arcmd = 'UnZip'
  33.    else exit  /* unknown extension */
  34.  
  35. /* Create and execute the command (CD dir\n Arc x filename) */
  36.  
  37. address command 'CD' dir || '0A'x arcmd filename
  38.  
  39.